<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>FrozenUI Demo</title>
    <link rel="stylesheet" href="static/frozenui-1.3.0/css/frozen.css">
</head>
<body style="margin:0;background:url('http://img05.tooopen.com/images/20140326/sy_57640132134.jpg') no-repeat;background-size:cover;">
<section>
    <div id="msgShow">

    </div>
</section>
<script src="/static/frozenui-1.3.0/lib/zepto.min.js"></script>
<script src="/static/frozenui-1.3.0/js/frozen.js"></script>
<script src="/static/frozenui-1.3.0/lib/sockjs.js"></script>
<script>
    var websocket;
    // 首先判断是否 支持 WebSocket
    if('WebSocket' in window) {
        websocket = new WebSocket("ws://120.79.198.159:80/gamingDataForHero?flag=88");
    }else {
        websocket = new SockJS("http://120.79.198.159:80/gamingDataForHero?flag=88");
    }
    websocket.onopen = function (event) {
        console.log(event);
        websocket.send("88")
    };
    websocket.onmessage = function (event) {
        console.log(event);
    };
    websocket.onclose = function (event) {
        websocket.close()
    }

</script>
</body>
</html>